package com.yy.wga.admin.service.controller;


import com.yy.wga.mp.module.admin.request.AdminOrderGoodsPageRequest;
import com.yy.wga.mp.module.admin.response.AdminOrderGoodsDetailResponse;
import com.yy.wga.mp.module.admin.response.AdminOrderGoodsPageResponse;
import com.yy.wga.mp.module.order.service.OrderDeliveryAddressService;
import com.yy.wga.mp.module.order.service.OrderGoodsService;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 运营后台/订单管理
 *
 * @author guochao
 * @since 2024-11-01 21:14:37
 */
@RestController
@RequestMapping("admin/order/goods")
public class AdminOrderGoodsController {
    /**
     * 服务对象
     */
    @Resource
    private OrderGoodsService orderGoodsService;
    @Resource
    private OrderDeliveryAddressService deliveryAddressService;


    @PostMapping("page")
    public Result<PageBean<AdminOrderGoodsPageResponse>> page(@Valid @RequestBody AdminOrderGoodsPageRequest request) {
        PageBean<AdminOrderGoodsPageResponse> pageBean = orderGoodsService.pageData(request);
        return Result.success(pageBean);
    }

    @GetMapping("get")
    public Result<AdminOrderGoodsDetailResponse> get(@RequestParam("id") Long id) {
        AdminOrderGoodsDetailResponse response = orderGoodsService.getDetail(id);
        return Result.success(response);
    }
}
